package Test;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author feng
 * @Date 2021/9/22 8:53
 */
public class Test01 {
    public static void main(String[] args) {
        int[] array = new int[5];
        System.out.println("请输入5个数:");
        Scanner sc = new Scanner(System.in);
        int sum = 0;
        int t = 0;

        for (int i = 0; i <array.length ; i++) {
               t = sc.nextInt();
               array[i] = t;
               sum += t;
        }
        int min = array[0];
        int max = array[0];
        Arrays.sort(array);
        for (int i = 0; i <array.length ; i++) {
          if (array[i] < min){
              min = array[i];
          }
          if (array[i] > max){
              max  = array[i];
          }
        }
        System.out.println("和" + sum);
        System.out.println("平均值" + sum/5);
        System.out.println("最小值" + min);
        System.out.println("最大值" + max);

    }
}
